<template>
	<div class="system bg-f5">
		<van-list
		  	v-model="loading"
		  	:finished="finished"
		  	@load="loadData"
		  	class="bg-white container"
		>
			<van-cell
			    v-for="(item,index) in data"
			    :key="index"
			 >
			 <div class="border-b">
			  	<h3 class="layout fs15 c333 pt15 pb15">系统消息<span class="fs12 c666">{{ item.created_at }}</span></h3>
				<p class="fs13 c666 pb20">{{ item.content }}</p>
			 </div>
			</van-cell>
		</van-list>
	</div>
</template>

<script>
  import { List } from 'vant';
	export default{
        components: {
            List
        },
		data()
		{
			return{
				data 		: [],
				page        : 1,
				loading 	: false,
				finished 	: false,
			}
		},
		created()
		{
			this.loadData();
		},
		methods:
		{
			loadData()
			{
				this.loading = true;
                let params = {
                    limit  : 20,
                    page   : this.page++
                }
				this.$http.get('/info/getsysinfo').then( res=> {
					if(res.data.list.length){
                        this.data = this.data.concat(res.data.list);
                        this.loading = false;
                    }
                    if(res.data.list.length < params.limit){
                        this.finished = true;
                    }
				})
			}
		}
	}
</script>

<style lang="less">
	.system{
		.van-list{
			&:last-child{
				border-bottom:none;
			}
		}
	}
</style>